<?php
class Userrule_Model_Updateuserrule implements Userrule_Model_Mainable{
    
    private $core_controller_notnull;
    private $core_controller_tokenchckout;
    
    private $excepted_result;
    private $current_result;
    
    private $userrule_model_updateoradd;
    
    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_tokenchckout = new Core_Controller_Tokencheckout;
        //var_dump($variables);
        //die();
        $this->core_controller_notnull->main($variables);
        //$this->core_controller_tokenchckout->main($variables['post']);
        
        $this->userrule_model_updateoradd = new Userrule_Model_Updateoradd;
        $this->current_result = $this->userrule_model_updateoradd->main($variables);
        if(
                $this->current_result == $this->excepted_result
                ){
            header("Location: ".SITE_ROOT."przypisz-role.html");
        }
        else {
            header("Location: ".SITE_ROOT."przypisz-role.html");
        }
    }
}
